-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Export CSV] Export data stored in new proto-based format #1917
Conversation
…to gino-m/1779/export-csv-from-pb-data
…to gino-m/1779/export-csv-from-pb-data
…to gino-m/1779/export-csv-from-pb-data
…to gino-m/1779/export-csv-from-pb-data
…to gino-m/1779/export-csv-from-pb-data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just nits and some interesting db/client sync questions with the proto changes. Otherwise, LGTM!
functions/src/export-csv.ts
Outdated
response: Pb.TaskData.IDateTimeResponse | ||
): string | null { | ||
const seconds = response.dateTime?.seconds; | ||
if (seconds === undefined || seconds === null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seconds != null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What did you mean here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I should have been more clear! There's a funny quirk language feature that allows you to check for both null
and undefined
with non-strict equality like this:
https://stackoverflow.com/a/16607837
I personally think that it's better to not explicitly check for both null and undefined unless the specifications of the object explicitly define null and undefined to represent different states (which is the 1% case), and opt for simpler, cleaner code to help JS hide it's mistake of putting in TWO nulls in its language ahah.
@@ -40,4 +39,7 @@ message AuditInfo { | |||
|
|||
// URL of the user's profile picture. | |||
string photo_url = 5; | |||
|
|||
// The user's email address. | |||
string email_address = 6; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should note that we will need to fix the app client to address this, since we were storing and querying by user_id
, which may constitute a large/breaking change...
Can you file a bug on the Android side and I can quickly get this fixed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Querying for what, exactly? Ad hoc LOIs? If so, wouldn't that continue to work, since this is just an additive change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooh... I must have gotten the Survey's ACL field confused with AuditInfo. I think we should be ok! We'll just want to make sure we're clear which field is meant to be the primary key etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sufyanAbbasi All comments resolved, modulo two follow-up questions. PTAL?
@@ -40,4 +39,7 @@ message AuditInfo { | |||
|
|||
// URL of the user's profile picture. | |||
string photo_url = 5; | |||
|
|||
// The user's email address. | |||
string email_address = 6; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Querying for what, exactly? Ad hoc LOIs? If so, wouldn't that continue to work, since this is just an additive change?
functions/src/export-csv.ts
Outdated
response: Pb.TaskData.IDateTimeResponse | ||
): string | null { | ||
const seconds = response.dateTime?.seconds; | ||
if (seconds === undefined || seconds === null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I should have been more clear! There's a funny quirk language feature that allows you to check for both null
and undefined
with non-strict equality like this:
https://stackoverflow.com/a/16607837
I personally think that it's better to not explicitly check for both null and undefined unless the specifications of the object explicitly define null and undefined to represent different states (which is the 1% case), and opt for simpler, cleaner code to help JS hide it's mistake of putting in TWO nulls in its language ahah.
@@ -40,4 +39,7 @@ message AuditInfo { | |||
|
|||
// URL of the user's profile picture. | |||
string photo_url = 5; | |||
|
|||
// The user's email address. | |||
string email_address = 6; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooh... I must have gotten the Survey's ACL field confused with AuditInfo. I think we should be ok! We'll just want to make sure we're clear which field is meant to be the primary key etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much!!
…com/google/ground-platform into gino-m/1779/export-csv-from-pb-data
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you++! Sorry we had to modify the linter to satisfy the odd hills I want to die on haha
Towards #1779.
One merged, I'll send a separate PR to read the
Survey
metadata in the new proto format when exporting.